package dwz.persistence;

import java.util.Date;
import java.util.List;

/** 
* Created by Eclipse
* @author : Yating
* @version:2017年5月24日 下午4:21:28 
* 类说明 
*/
public class ArticleConditionVO {
	public final static int PAGE_SHOW_COUNT = 20;
	private int pageNum = 1;
	private int pageSize = 0;
	private int totalCount = 0;
	private String orderField;
	private String orderDirection;
	private String keywords;
	private String type;
	// article中的字段
	private Date createtimeStart;
	private Date createtimeEnd;
	private Date modifytimeStart;
	private Date modifytimeEnd;
	private Date publishtimeStart;
	private Date publishtimeEnd;
	private String title;
	private String authorid;
	private String source;
	private String state;
	
	private List<String> codeList;
	private int channelid;
	private int seq;
	
	public String getType() {
		return "".equals(type) ? null : type;
	}
	public void setType(String type) {
		this.type = type;
	}
	public Date getCreatetimeStart() {
		return createtimeStart;
	}
	public void setCreatetimeStart(Date createtimeStart) {
		this.createtimeStart = createtimeStart;
	}
	public Date getCreatetimeEnd() {
		return createtimeEnd;
	}
	public void setCreatetimeEnd(Date createtimeEnd) {
		this.createtimeEnd = createtimeEnd;
	}
	
	public Date getModifytimeStart() {
		return modifytimeStart;
	}
	public void setModifytimeStart(Date modifytimeStart) {
		this.modifytimeStart = modifytimeStart;
	}
	public Date getModifytimeEnd() {
		return modifytimeEnd;
	}
	public void setModifytimeEnd(Date modifytimeEnd) {
		this.modifytimeEnd = modifytimeEnd;
	}
	
	public Date getPublishtimeStart() {
		return publishtimeStart;
	}
	public void setPublishtimeStart(Date publishtimeStart) {
		this.publishtimeStart = publishtimeStart;
	}
	public Date getPublishtimeEnd() {
		return publishtimeEnd;
	}
	public void setPublishtimeEnd(Date publishtimeEnd) {
		this.publishtimeEnd = publishtimeEnd;
	}
	
	public String getAuthorid() {
		return authorid;
	}
	public void setAuthorid(String authorid) {
		this.authorid = authorid;
	}
	
	public String getSource() {
		return source;
	}
	public void setSource(String source) {
		this.source = source;
	}
	
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	
	public String getState() {
		return state;
	}
	public void setState(String state) {
		this.state = state;
	}
	
	public List<String> getCodeList() {
		return codeList;
	}
	public void setCodeList(List<String> codeList) {
		this.codeList = codeList;
	}
	
	public int getChannelId() {
		return channelid;
	}
	public void setChannelId(int channelid) {
		this.channelid = channelid;
	}
	
	public int getSeq() {
		return seq;
	}
	public void setSeq(int seq) {
		this.seq = seq;
	}
	
	
	
	public int getPageNum() {
		return pageNum;
	}
	public void setPageNum(int pageNum) {
		this.pageNum = pageNum;
	}
	public int getPageSize() {
		return pageSize > 0 ? pageSize : PAGE_SHOW_COUNT;
	}
	public void setPageSize(int pageSize) {
		this.pageSize = pageSize;
	}
	public String getOrderField() {
		return orderField;
	}
	public void setOrderField(String orderField) {
		this.orderField = orderField;
	}
	public String getOrderDirection() {
		return "desc".equals(orderDirection) ? "desc" : "asc";
	}
	public void setOrderDirection(String orderDirection) {
		this.orderDirection = orderDirection;
	}
	
	public int getTotalCount() {
		return totalCount;
	}

	public void setTotalCount(int totalCount) {
		this.totalCount = totalCount;
	}
	
	public String getKeywords() {
		return "".equals(keywords)? null : keywords;
	}
	public void setKeywords(String keywords) {
		this.keywords = keywords;
	}
	
	public int getStartIndex() {
		int pageNum = this.getPageNum() > 0 ? this.getPageNum() - 1 : 0;
		return pageNum * this.getPageSize();
	}
}